#pragma once
#include <iostream>
#include <fstream>
#include "character.h"

#include <string>
using namespace std;


class word:public character{
public:
	string word_;
	string discription;
	char vislble;
	int wordNum;
	int x_;
	int y_;
	int direction;
	character *st;
	character *en;
	void setting_word(string a,string str2){
		direction=0;
		x_=0;
		y_=0;
		vislble=0;
		wordNum=0;
		st = new character();
		en = new character();
		st->next=en;
		en->prev=st;
		word_=a;
		makeWord(a);
		discription=str2;
	}
	word(){
	}
	void makeWord(string str){
		character *current=st;
		int len=str.length();
		for(int i=len;i>-1;i--){
			character *temp =new character(current,current->next,str.substr(i,1));
			temp->next->prev=temp;
			current->next=temp;

		}

	}
	void setVisible(){
		character *current=st->next;
		 
		
		while(current->next!=NULL){
			current->setVisible();
			current=current->next;

		}
	}
	void trav(){
		character *current=st->next;
		 
		
		while(current->next!=NULL){
			cout<<current->ch;
			current=current->next;

		}
		cout<<endl;
	}
	void setNumber(int num){
		st->next->first=num;
		 
	}
	void setProperties(int x=0,int y=0,int d=0){
		this->x_=x;
		this->y_=y;
		this->direction=d;
		if(this->word_.length()>10){
			this->direction=0;
		}
	}
};